﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CoolCode.Entity
{
    public abstract  class EntityBase
    {
        public Guid Guid { get; set; }

        public Guid CreateUserUID { get; set; }

        public Guid LastUpdateUserUID { get; set; }

        public DateTime CreateDate { get; set; }

        public DateTime LastUpdateDate { get; set; }

        public EntityBase() : this(Guid.NewGuid()) { }

        public EntityBase(User _user) : this(_user.Guid) { }

        public EntityBase(Guid _CreateUserUID)
        {
            this.Guid = Guid.NewGuid();
            CreateUserUID = _CreateUserUID;
            LastUpdateUserUID = _CreateUserUID;
            CreateDate = DateTime.Now;
            LastUpdateDate = DateTime.Now;

        }
        public override string ToString()
        {
            return string.Format("Guid:{0}, Create ID:{1}, Date:{2}", Guid, CreateUserUID, CreateDate);
        }
    }
}
